﻿using System;
using System.Linq;
using LINQPad.Extensibility.DataContext;
using LINQPad.OpenAccess.Settings;

namespace LINQPad.OpenAccess.Services
{
    /// <summary>
    /// DataContext settings repository.
    /// </summary>
    public interface IDataContextSettingsRepository
    {
        /// <summary>
        /// Gets the default settings.
        /// </summary>
        /// <param name="connectionInfo">The connection info.</param>
        /// <returns>
        /// The default settings
        /// </returns>
        DriverSettings GetDefaultSettings( IConnectionInfo connectionInfo );
        /// <summary>
        /// Gets the settings.
        /// </summary>
        /// <param name="connectionInfo">The connection info.</param>
        /// <returns>
        /// The driver settings or <c>null</c>.
        /// </returns>
        DriverSettings GetSettings( IConnectionInfo connectionInfo );
        /// <summary>
        /// Saves the settings.
        /// </summary>
        /// <param name="connectionInfo">The connection info.</param>
        /// <param name="settings">The settings.</param>
        void SaveSettings( IConnectionInfo connectionInfo, DriverSettings settings );
    }
}
